
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>stylus使用介绍 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="TypeError Cannot read property 'compilation' of undefined.html" />
    
    
    <link rel="prev" href="router-link各种属性解释.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../cmd命令.html">
            
                <a href="../cmd命令.html">
            
                    
                    cmd命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="Array.prototype.slice.call.html">
            
                <a href="Array.prototype.slice.call.html">
            
                    
                    Array.prototype.slice.call解析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="async 函数.html">
            
                <a href="async 函数.html">
            
                    
                    async 函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="callback&&callback如果存在回调函数就执行.html">
            
                <a href="callback&&callback如果存在回调函数就执行.html">
            
                    
                    callback&&callback() 如果存在回调函数就执行！
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="CSS3 nth-child使用注意.html">
            
                <a href="CSS3 nth-child使用注意.html">
            
                    
                    CSS3 nth-child(n)使用注意
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="css3的 -webkit-min-device-pixel-ratio属性 解决高清的适配.html">
            
                <a href="css3的 -webkit-min-device-pixel-ratio属性 解决高清的适配.html">
            
                    
                    css3的 -webkit-min-device-pixel-ratio属性 解决高清的适配
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="CSS文本超出自动缩小字体.html">
            
                <a href="CSS文本超出自动缩小字体.html">
            
                    
                    CSS文本超出自动缩小字体
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="element-ui默认样式修改.html">
            
                <a href="element-ui默认样式修改.html">
            
                    
                    element-ui默认样式修改
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="JavaScript setInterval函数详解.html">
            
                <a href="JavaScript setInterval函数详解.html">
            
                    
                    JavaScript setInterval() 函数详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="JavaScript概念之screenclientoffsetscrollinneravail的widthleft.html">
            
                <a href="JavaScript概念之screenclientoffsetscrollinneravail的widthleft.html">
            
                    
                    JavaScript概念之screenclientoffsetscrollinneravail的widthleft
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="js获取星期几.html">
            
                <a href="js获取星期几.html">
            
                    
                    js获取星期几
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="js监听滚动条事件和获取浏览器及屏幕高度和宽度等信息的方法.html">
            
                <a href="js监听滚动条事件和获取浏览器及屏幕高度和宽度等信息的方法.html">
            
                    
                    js监听滚动条事件和获取浏览器及屏幕高度和宽度等信息的方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="js时间戳与日期格式之间相互转换.html">
            
                <a href="js时间戳与日期格式之间相互转换.html">
            
                    
                    js时间戳与日期格式之间相互转换
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="JS数组reduce方法详解及高级技巧.html">
            
                <a href="JS数组reduce方法详解及高级技巧.html">
            
                    
                    JS数组reduce()方法详解及高级技巧
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.16" data-path="js中获取时间new Date详细介绍.html">
            
                <a href="js中获取时间new Date详细介绍.html">
            
                    
                    js中获取时间new Date()详细介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17" data-path="less传参问题：在url中插入变量今天在需要用less给url传递参数时遇到了小问题，一番搜索后有了下述解决方法.html">
            
                <a href="less传参问题：在url中插入变量今天在需要用less给url传递参数时遇到了小问题，一番搜索后有了下述解决方法.html">
            
                    
                    less传参问题：在url中插入变量今天在需要用less给url传递参数时遇到了小问题，一番搜索后有了下述解决方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.18" data-path="moment 和date-fns.html">
            
                <a href="moment 和date-fns.html">
            
                    
                    moment 和date-fns
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.19" data-path="node.JS中配置http-server.html">
            
                <a href="node.JS中配置http-server.html">
            
                    
                    node.JS中配置http-server
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.20" data-path="Object.keys详解.html">
            
                <a href="Object.keys详解.html">
            
                    
                    Object.keys详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.21" data-path="router-link各种属性解释.html">
            
                <a href="router-link各种属性解释.html">
            
                    
                    router-link各种属性解释
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.22" data-path="stylus使用介绍.html">
            
                <a href="stylus使用介绍.html">
            
                    
                    stylus使用介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.23" data-path="TypeError Cannot read property 'compilation' of undefined.html">
            
                <a href="TypeError Cannot read property 'compilation' of undefined.html">
            
                    
                    TypeError Cannot read property 'compilation' of undefined
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.24" data-path="Vue  keep-alive.html">
            
                <a href="Vue  keep-alive.html">
            
                    
                    Vue  keep-alive
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.25" data-path="Vue - 过渡与动画transition.html">
            
                <a href="Vue - 过渡与动画transition.html">
            
                    
                    Vue - 过渡与动画transition
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.26" data-path="vue-axios使用方法.html">
            
                <a href="vue-axios使用方法.html">
            
                    
                    vue-axios使用方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.27" data-path="vue-calendar-component.html">
            
                <a href="vue-calendar-component.html">
            
                    
                    vue-calendar-component
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.28" data-path="vue-infinite-loading.html">
            
                <a href="vue-infinite-loading.html">
            
                    
                    vue-infinite-loading
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.29" data-path="vue报错There are multiple modules with names that only differ in casing.html">
            
                <a href="vue报错There are multiple modules with names that only differ in casing.html">
            
                    
                    vue报错There are multiple modules with names that only differ in casing
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.30" data-path="Vue中注意target和currentTarget的使用.html">
            
                <a href="Vue中注意target和currentTarget的使用.html">
            
                    
                    Vue中注意target和currentTarget的使用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.31" data-path="关于给javascript对象添加、删除、修改对象的属性.html">
            
                <a href="关于给javascript对象添加、删除、修改对象的属性.html">
            
                    
                    关于给javascript对象添加、删除、修改对象的属性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.32" data-path="获取当前地址坐标.html">
            
                <a href="获取当前地址坐标.html">
            
                    
                    获取当前地址坐标
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.33" data-path="解决ajax跨域问题【5种解决方案】.html">
            
                <a href="解决ajax跨域问题【5种解决方案】.html">
            
                    
                    解决ajax跨域问题【5种解决方案】
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.34" data-path="解决vue-cli webpack打包后加载资源的路径问题.html">
            
                <a href="解决vue-cli webpack打包后加载资源的路径问题.html">
            
                    
                    解决vue-cli webpack打包后加载资源的路径问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.35" data-path="时间格式转换：201971转换为2019-7-1.html">
            
                <a href="时间格式转换：201971转换为2019-7-1.html">
            
                    
                    时间格式转换：201971转换为2019-7-1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.36" data-path="数据库密码改了.html">
            
                <a href="数据库密码改了.html">
            
                    
                    数据库密码改了
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.37" data-path="语法getBoundingClientRect.html">
            
                <a href="语法getBoundingClientRect.html">
            
                    
                    语法getBoundingClientRect()
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.38" data-path="在js中使用length报错Error in renderTypeErrorcannot read property bgImg of null.html">
            
                <a href="在js中使用length报错Error in renderTypeErrorcannot read property bgImg of null.html">
            
                    
                    在js中使用length报错Error in renderTypeErrorcannot read property bgImg of null
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >stylus使用介绍</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="stylus&#x57FA;&#x672C;&#x4F7F;&#x7528;">Stylus&#x57FA;&#x672C;&#x4F7F;&#x7528;</h1>
<p>stylus&#x8F6C;less:</p>
<p>&#x5148;&#x5168;&#x5C40;&#x5B89;&#x88C5;stylus</p>
<pre><code>$ npm install stylus -g
</code></pre><p>&#x7136;&#x540E;&#x5C06;stylus&#x8F6C;&#x4E3A;css</p>
<pre><code class="lang-shell">stylus example.styl
</code></pre>
<p>&#x8FDB;&#x5165;&#x8BE5;&#x7F51;&#x7AD9;<a href="http://tools.jb51.net/code/css2less" target="_blank">http://tools.jb51.net/code/css2less</a></p>
<p>&#x4E0A;&#x4F20;css&#x6587;&#x4EF6;&#xFF0C;&#x8F6C;&#x5316;&#x4E3A;less</p>
<h1 id="&#x4ECB;&#x7ECD;">&#x4ECB;&#x7ECD;</h1>
<p>&#x8FD9;&#x4E2A;&#x54E5;&#x4EEC;&#x513F;&#x5B66;&#x540D;&#x53EB; stylus&#xFF0C;&#x662F; CSS &#x7684;&#x9884;&#x5904;&#x7406;&#x6846;&#x67B6;&#x3002;</p>
<p>CSS &#x9884;&#x5904;&#x7406;&#xFF0C;&#x987E;&#x540D;&#x601D;&#x4E49;&#xFF0C;&#x9884;&#x5148;&#x5904;&#x7406; CSS&#x3002;&#x90A3; stylus &#x548B;&#x9884;&#x5148;&#x5904;&#x7406;&#x5462;&#xFF1F;stylus &#x7ED9; CSS &#x6DFB;&#x52A0;&#x4E86;&#x53EF;&#x7F16;&#x7A0B;&#x7684;&#x7279;&#x6027;&#xFF0C;&#x4E5F;&#x5C31;&#x662F;&#x8BF4;&#xFF0C;&#x5728; stylus &#x4E2D;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x53D8;&#x91CF;&#x3001;&#x51FD;&#x6570;&#x3001;&#x5224;&#x65AD;&#x3001;&#x5FAA;&#x73AF;&#x4E00;&#x7CFB;&#x5217; CSS &#x6CA1;&#x6709;&#x7684;&#x4E1C;&#x897F;&#x6765;&#x7F16;&#x5199;&#x6837;&#x5F0F;&#x6587;&#x4EF6;&#xFF0C;&#x6267;&#x884C;&#x8FD9;&#x4E00;&#x5957;&#x9A9A;&#x64CD;&#x4F5C;&#x4E4B;&#x540E;&#xFF0C;&#x8FD9;&#x4E2A;&#x6587;&#x4EF6;&#x53EF;&#x7F16;&#x8BD1;&#x6210; CSS &#x6587;&#x4EF6;&#x3002;</p>
<h2 id="&#x5B89;&#x88C5;">&#x5B89;&#x88C5;</h2>
<p>&#x9996;&#x5148;&#xFF0C;&#x5B89;&#x88C5; stylus&#xFF08;&#x786E;&#x4FDD;&#x4E4B;&#x524D;&#x5DF2;&#x7ECF;&#x5B89;&#x88C5; nodejs &#xFF09;&#x3002;</p>
<pre><code>$ npm install stylus
</code></pre><p>&#x5B89;&#x88C5;&#x4E4B;&#x540E;&#xFF0C;&#x8FD0;&#x884C; <code>stylus -h</code> &#x53EF;&#x67E5;&#x770B;&#x5E2E;&#x52A9;&#x3002;
 &#x8FD0;&#x884C; <code>stylus example.styl</code> &#x53EF;&#x5C06; demo.styl &#x6587;&#x4EF6;&#x7F16;&#x8BD1;&#x6210; example.css &#x6587;&#x4EF6;&#x3002;</p>
<h2 id="&#x57FA;&#x672C;&#x4F7F;&#x7528;">&#x57FA;&#x672C;&#x4F7F;&#x7528;</h2>
<p>&#x4E00;&#x6BB5;&#x7B80;&#x5355;&#x7684; stylus &#x4EE3;&#x7801;&#xFF1A;</p>
<pre><code>$background-color = lightblue
add (a, b = a)
    a = unit(a, px)
    b = unit(b, px)
    a + b

.list-item
.text-box
    span
        background-color: $background-color
        margin: add(10)
        padding: add(10, 5)
    &amp;:hover
        background-color: powderblue
</code></pre><p>&#x7F16;&#x8BD1;&#x540E;&#x751F;&#x6210;&#x7684; CSS &#x4EE3;&#x7801;&#xFF1A;</p>
<pre><code>.list-item span,
.text-box span {
  background-color: #add8e6;
  margin: 20px;
  padding: 15px
}
.list-item:hover,
.text-box:hover {
  background-color: #b0e0e6;
}
</code></pre><p>&#x7531;&#x6B64;&#x6211;&#x4EEC;&#x770B;&#x5230;&#x4E86; stylus &#x4EE3;&#x7801;&#x4EE5;&#x53CA;&#x7531;&#x5B83;&#x7F16;&#x8BD1;&#x800C;&#x6210;&#x7684; CSS &#x4EE3;&#x7801;,&#x4E0B;&#x9762;&#x6765;&#x4E00;&#x6B65;&#x4E00;&#x6B65;&#x770B;&#x4E00;&#x770B;&#x4E3A;&#x5565;&#x7F16;&#x8BD1;&#x6210;&#x8FD9;&#x6837;&#x3002;</p>
<h3 id="&#x53D8;&#x91CF;">&#x53D8;&#x91CF;</h3>
<pre><code>$background-color = lightblue
</code></pre><p>&#x4E0A;&#x9762;&#x7684;&#x4EE3;&#x7801;&#x58F0;&#x660E;&#x4E86;&#x53D8;&#x91CF; <code>$background-color</code>,&#x5E76;&#x4E3A;&#x5176;&#x8D4B;&#x503C; <code>lightblue</code>&#x3002;
 &#x58F0;&#x660E;&#x4E4B;&#x540E;&#xFF0C;&#x5C31;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x8FD9;&#x4E2A;&#x53D8;&#x91CF;&#x4E86;&#xFF1A;</p>
<pre><code>span
    background-color: $background-color
</code></pre><p>&#x7FFB;&#x8BD1;&#x6210; CSS &#x5C31;&#x662F;&#xFF1A;</p>
<pre><code>span{
    background-color: lightblue;
}
</code></pre><h3 id="&#x51FD;&#x6570;">&#x51FD;&#x6570;</h3>
<pre><code>add (a, b = a)
    a = unit(a, px)
    b = unit(b, px)
    a + b
</code></pre><p>&#x4EE3;&#x7801;&#x58F0;&#x660E;&#x4E86;&#x51FD;&#x6570; <code>add</code>, <code>add</code> &#x63A5;&#x53D7;&#x4E24;&#x4E2A;&#x53C2;&#x6570; <code>a</code> &#x548C; <code>b</code>&#xFF0C;&#x5176;&#x4E2D; <code>b</code> &#x7684;&#x9ED8;&#x8BA4;&#x503C;&#x662F; <code>a</code>&#x3002;
 <code>add</code> &#x4E2D;&#x8C03;&#x7528;&#x4E86; stylus &#x7684;&#x5185;&#x7F6E;&#x51FD;&#x6570; <code>unit</code>&#xFF0C;&#x6B64;&#x5904;&#xFF0C;<code>unit</code> &#x51FD;&#x6570;&#x4E3A; <code>a</code> &#x548C; <code>b</code>&#x8D4B;&#x4E88;&#x4E86;&#x5355;&#x4F4D; <code>px</code>&#x3002;
 &#x6700;&#x540E;&#x5C06; <code>a</code> &#x548C; <code>b</code> &#x76F8;&#x52A0;&#xFF0C;&#x5E76;&#x8FD4;&#x56DE;&#x7ED3;&#x679C;&#xFF0C;&#x662F;&#x7684;&#xFF0C;&#x4F60;&#x6CA1;&#x6709;&#x770B;&#x9519;&#xFF0C;&#x6CA1;&#x6709; <code>return</code>&#xFF0C;&#x4F46;&#x662F;&#x8FD4;&#x56DE;&#x4E86;&#x7ED3;&#x679C;&#x3002;
 <code>return</code> &#x5C45;&#x7136;&#x662F;&#x53EF;&#x4EE5;&#x7701;&#x7565;&#x7684;&#xFF0C;&#x5F88;&#x4EFB;&#x6027;&#x4E86;&#x3002;</p>
<p>&#x51FD;&#x6570;&#x8C03;&#x7528;&#xFF1A;</p>
<pre><code>span
    margin: add(10)
    padding: add(10, 5)
</code></pre><p>&#x7FFB;&#x8BD1;&#x6210; CSS &#x5C31;&#x662F;&#xFF1A;</p>
<pre><code>span {
    margin: 20px;
    padding: 15px;
}
</code></pre><h3 id="&#x9009;&#x62E9;&#x5668;">&#x9009;&#x62E9;&#x5668;</h3>
<pre><code>.list-item
.text-box
    span
        background-color: $background-color
        margin: add(10)
        padding: add(10, 5)
    &amp;:hover
        background-color: powderblue
</code></pre><p>&#x8FD9;&#x4E00;&#x6BB5;&#x662F;&#x4E0E; CSS &#x4EE3;&#x7801;&#x957F;&#x5F97;&#x6700;&#x50CF;&#x7684;&#x4E86;&#xFF0C;&#x867D;&#x8BF4;&#x6700;&#x4E3A;&#x76F8;&#x50CF;&#xFF0C;&#x53EF;&#x6709;&#x4E9B;&#x5DEE;&#x522B;&#x8FD8;&#x662F;&#x4E00;&#x773C;&#x5C31;&#x80FD;&#x770B;&#x51FA;&#x7684;&#x3002;
 &#x6BD4;&#x5982;&#x6CA1;&#x6709;&#x4E86; CSS &#x7684;&#x82B1;&#x62EC;&#x53F7;&#xFF0C;&#x6CA1;&#x6709;&#x4E86; CSS &#x7684;&#x5206;&#x53F7;&#xFF0C;&#x5374;&#x591A;&#x4E86;&#x4E00;&#x4E9B;&#x5947;&#x5947;&#x602A;&#x602A;&#x7684;&#x7F29;&#x8FDB;&#xFF0C;&#x8FD8;&#x6709;&#x90A3;&#x4E2A; <code>&amp;</code> &#x662F;&#x4EC0;&#x4E48;&#x9B3C;&#xFF1F;&#x8FD8; <code>&amp;:hover</code> ???
 &#x9884;&#x77E5;&#x540E;&#x4E8B;&#x5982;&#x4F55;&#xFF0C;&#x8FD9;&#x6B21;&#x63A5;&#x7740;&#x5206;&#x89E3;&#x3002;</p>
<p>&#x5148;&#x8BF4;&#x7B26;&#x53F7;&#xFF0C;&#x8FD9;&#x91CC;&#x63D0;&#x5230;&#x7684;&#x82B1;&#x62EC;&#x53F7;&#x548C;&#x5206;&#x53F7;&#x5728;stylus&#x4E2D;&#x662F;&#x53EF;&#x4EE5;&#x7701;&#x7565;&#x7684;&#xFF0C;&#x4E0D;&#x4EC5;&#x5982;&#x6B64;&#xFF0C;&#x5192;&#x53F7;&#x4E5F;&#x662F;&#x53EF;&#x4EE5;&#x7701;&#x7565;&#x7684;&#xFF0C;<code>color: powderblue</code> &#x4F60;&#x53EF;&#x4EE5;&#x5199;&#x6210; <code>color powderblue</code>,&#x6CA1;&#x6709;&#x95EE;&#x9898;&#x3002;</p>
<p>&#x518D;&#x8BF4;&#x7F29;&#x8FDB;&#xFF0C;&#x5148;&#x63D0;&#x51FA;&#x4E24;&#x4E2A;&#x6709;&#x7F29;&#x8FDB;&#x5173;&#x7CFB;&#x7684;&#x9009;&#x62E9;&#x5668;&#xFF0C;&#x4E0A;&#x9762;&#x4EE3;&#x7801;&#x7247;&#x6BB5;&#x7B2C;&#x4E8C;&#x884C;&#x7684; <code>.text-box</code> &#x548C;&#x7B2C;&#x4E09;&#x884C;&#x7684; <code>span</code>&#xFF0C;&#x5176;&#x5B9E;&#x5F88;&#x5BB9;&#x6613;&#x7406;&#x89E3;&#xFF0C;&#x8FD9;&#x54E5;&#x4FE9;&#x5199;&#x5230; CSS &#x91CC;&#x9762;&#x662F;&#x8FD9;&#x6837;&#x7684;&#xFF1A;</p>
<pre><code>.text-box span{ ... }
</code></pre><p>&#x5373; <code>span</code> &#x662F; <code>.text-box</code> &#x7684;&#x5B50;&#x9009;&#x62E9;&#x5668;&#xFF0C;stylus &#x4E2D;&#x4EE5;&#x7F29;&#x8FDB;&#x8868;&#x793A;&#x8FD9;&#x79CD;&#x5173;&#x7CFB;&#xFF0C;&#x66F4;&#x52A0;&#x6E05;&#x6670;&#x660E;&#x4E86;&#xFF0C;&#x597D;&#x770B;&#x3002;</p>
<p>&#x8FD8;&#x6709; <code>&amp;</code>&#xFF0C;&#x8FD9;&#x662F;&#x4E2A;&#x65B0;&#x9C9C;&#x4E1C;&#x897F;&#x3002;&#x5B83;&#x662F;&#x7236;&#x7EA7;&#x7684;&#x5F15;&#x7528;&#xFF0C;&#x8FD8;&#x662F;&#x6765;&#x770B;&#x4EE3;&#x7801;&#x3002;</p>
<p>stylus&#x8FD9;&#x6837;&#x5199;:</p>
<pre><code>.list-item
.text-box
    &amp;:hover
        background-color: powderblue
</code></pre><p>&#x7FFB;&#x8BD1;&#x6210; CSS &#x662F;&#x8FD9;&#x6837;&#xFF1A;</p>
<pre><code>.list-item:hover,
.text-box:hover {
  background-color: #b0e0e6;
}
</code></pre><p>&#x76F8;&#x4FE1;&#x4EE3;&#x7801;&#x4E2D;&#x5DF2;&#x7ECF;&#x80FD;&#x5F88;&#x660E;&#x786E;&#x5730;&#x4F53;&#x73B0;&#x51FA; <code>&amp;</code> &#x7236;&#x7EA7;&#x5F15;&#x7528;&#x7684;&#x89D2;&#x8272;&#x4E86;&#x3002;
 &#x540C;&#x65F6;&#xFF0C;&#x6211;&#x4EEC;&#x4E5F;&#x4E0D;&#x96BE;&#x770B;&#x51FA;&#xFF0C;<code>.list-item</code> &#x548C; <code>.text-box</code> &#x8FD9;&#x4E24;&#x4E2A;&#x540C;&#x4E00;&#x7EA7;&#x7684;&#x9009;&#x62E9;&#x5668;&#x5728; stylus &#x4E2D;&#x662F;&#x53EF;&#x4EE5;&#x6362;&#x884C;&#x5199;&#x7684;&#xFF0C;&#x53EA;&#x8981;&#x4FDD;&#x8BC1;&#x7F29;&#x8FDB;&#x76F8;&#x540C;&#xFF0C;&#x5B83;&#x4EEC;&#x5C31;&#x5C5E;&#x4E8E;&#x540C;&#x4E00;&#x7EA7;&#x7684;&#x9009;&#x62E9;&#x5668;&#x3002;&#x5F53;&#x7136;&#xFF0C;&#x6CBF;&#x7528; CSS &#x7684;&#x65B9;&#x5F0F;&#xFF0C;&#x5C06;&#x540C;&#x4E00;&#x7EA7;&#x7684;&#x9009;&#x62E9;&#x5668;&#x7528;&#x9017;&#x53F7;&#x5206;&#x9694;&#x5F00;&#x5728; stylus &#x4E2D;&#x4E5F;&#x662F;&#x53EF;&#x4EE5;&#x7684;&#x3002;</p>
<h2 id="&#x603B;&#x7ED3;">&#x603B;&#x7ED3;</h2>
<p>&#x4E0A;&#x9762;&#x5C31;&#x662F; stylus &#x7684;&#x57FA;&#x672C;&#x4F7F;&#x7528;&#xFF0C;&#x666E;&#x904D;&#x60C5;&#x51B5;&#x53EF;&#x4EE5;&#x7528;&#x4E0A;&#x3002;
 &#x5168;&#x9762;&#x7684; stylus &#x77E5;&#x8BC6;&#x53EF;&#x4EE5;&#x53C2;&#x8003;<a href="http://stylus-lang.com/" target="_blank">&#x5B98;&#x65B9;&#x6587;&#x6863;</a>&#xFF0C;&#x6216;&#x8005;&#x5F20;&#x946B;&#x65ED;&#x7FFB;&#x8BD1;&#x7684;<a href="http://www.zhangxinxu.com/jq/stylus/" target="_blank">&#x4E2D;&#x6587;&#x6587;&#x6863; </a>&#x3002;</p>
<p>&#x4F5C;&#x8005;&#xFF1A;&#x83F2;&#x5229;&#x666E;&#x9A6C;&#x6D1B;</p>
<p>&#x94FE;&#x63A5;&#xFF1A;<a href="https://www.jianshu.com/p/5fb15984f22d" target="_blank">https://www.jianshu.com/p/5fb15984f22d</a></p>
<p>&#x6765;&#x6E90;&#xFF1A;&#x7B80;&#x4E66;</p>
<p>&#x7B80;&#x4E66;&#x8457;&#x4F5C;&#x6743;&#x5F52;&#x4F5C;&#x8005;&#x6240;&#x6709;&#xFF0C;&#x4EFB;&#x4F55;&#x5F62;&#x5F0F;&#x7684;&#x8F6C;&#x8F7D;&#x90FD;&#x8BF7;&#x8054;&#x7CFB;&#x4F5C;&#x8005;&#x83B7;&#x5F97;&#x6388;&#x6743;&#x5E76;&#x6CE8;&#x660E;&#x51FA;&#x5904;&#x3002;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="router-link各种属性解释.html" class="navigation navigation-prev " aria-label="Previous page: router-link各种属性解释">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="TypeError Cannot read property 'compilation' of undefined.html" class="navigation navigation-next " aria-label="Next page: TypeError Cannot read property 'compilation' of undefined">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"stylus使用介绍","level":"1.22","depth":1,"next":{"title":"TypeError Cannot read property 'compilation' of undefined","level":"1.23","depth":1,"path":"project/TypeError Cannot read property 'compilation' of undefined.md","ref":"project/TypeError Cannot read property 'compilation' of undefined.md","articles":[]},"previous":{"title":"router-link各种属性解释","level":"1.21","depth":1,"path":"project/router-link各种属性解释.md","ref":"project/router-link各种属性解释.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"project/stylus使用介绍.md","mtime":"2019-06-15T03:00:35.110Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-07-18T03:07:23.077Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

